package com.ruoyi.verify.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.verify.domain.VerifyTemplateContent;
import com.ruoyi.verify.service.IVerifyTemplateContentService;

/**
 * 现场审核问卷 提供者
 * 
 * @author ygx
 * @date 2020-10-14
 */
@RestController
@RequestMapping("content")
public class VerifyTemplateContentController extends BaseController
{
	
	@Autowired
	private IVerifyTemplateContentService verifyTemplateContentService;
	
	/**
	 * 查询${tableComment}
	 */
	@GetMapping("get/{templateid}")
	public VerifyTemplateContent get(@PathVariable("templateid") String templateid)
	{
		return verifyTemplateContentService.selectVerifyTemplateContentById(templateid);
		
	}
	
	/**
	 * 查询现场审核问卷列表
	 */
	@GetMapping("list")
	public R list(VerifyTemplateContent verifyTemplateContent)
	{
		startPage();
        return result(verifyTemplateContentService.selectVerifyTemplateContentList(verifyTemplateContent));
	}
	
	
	/**
	 * 新增保存现场审核问卷
	 */
	@PostMapping("save")
	public R addSave(@RequestBody VerifyTemplateContent verifyTemplateContent)
	{		
		return toAjax(verifyTemplateContentService.insertVerifyTemplateContent(verifyTemplateContent));
	}

	/**
	 * 修改保存现场审核问卷
	 */
	@PostMapping("update")
	public R editSave(@RequestBody VerifyTemplateContent verifyTemplateContent)
	{		
		return toAjax(verifyTemplateContentService.updateVerifyTemplateContent(verifyTemplateContent));
	}
	
	/**
	 * 删除${tableComment}
	 */
	@PostMapping("remove")
	public R remove(String ids)
	{		
		return toAjax(verifyTemplateContentService.deleteVerifyTemplateContentByIds(ids));
	}
	
}
